package cn.edu.sdjzu.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;

@Service
public class ProviderService {
    @Autowired
    private WebClient.Builder webClientBuilder;

    public Mono<String> getHelloWorld(){
        return webClientBuilder.build().get()
                .uri("http://provider-service/hello")
                //.url(""http://localhost:8081/hello"")
                .retrieve()
                .bodyToMono(String.class);
    }
}
